home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / MW MPW Binaries 1.1.1a2 / mwcPPC / MWCIncludes / assert.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-18  |  850 b   |  40 lines  |  [TEXT/MMCC]

  1. /* assert.h standard header */
  2. #include <yvals.h>
  3.  
  4. #if __MWERKS__
  5. #pragma options align=mac68k
  6. #endif
  7.  
  8. #undef assert    /* remove existing definition */
  9.  
  10. #ifdef NDEBUG
  11.     #define assert(test)    ((void)0)
  12. #else            /* NDEBUG not defined */
  13. _C_LIB_DECL
  14.     void _Assert(char *);
  15. _END_C_LIB_DECL
  16.         /* macros */
  17.     #define _STR(x)    _VAL(x)
  18.     #define _VAL(x)    #x
  19. #ifdef _VERBOSE_DEBUGGING
  20. #include <stdio.h>
  21.     #define assert(test)    ((test) ? (void)fprintf( \
  22.         stderr, __FILE__ ":" _STR(__LINE__) " " #test " -- OK\n") \
  23.         : _Assert(__FILE__ ":" _STR(__LINE__) " " #test))
  24. #else
  25.     #define assert(test)    ((test) ? (void)0 \
  26.         : _Assert(__FILE__ ":" _STR(__LINE__) " " #test))
  27. #endif
  28.  
  29. #endif
  30.  
  31. #if __MWERKS__
  32. #pragma options align=reset
  33. #endif
  34.  
  35. /*
  36.  * Copyright (c) 1994 by P.J. Plauger.  ALL RIGHTS RESERVED. 
  37.  * Consult your license regarding permissions and restrictions.
  38.  */
  39.  
  40.